<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>Admin Home</title>
    <link rel="stylesheet" href="styles2.css">
    <style>
        .logout-button {
            position: absolute;
            top: 20px;
            right: 20px;
        }
        /* 可能需要在这里添加其他样式 */
    </style>
</head>
<body>
<div class="form-div">
    <div class="left">
        <a href="login.html" class="button logout-button">注销</a> <!-- 注销按钮 -->
        <h2>Students List</h2><a href="insertStudent.jsp" class="button">增加</a>
        <div class="scrollable-table">
            <table>
                <thead>
                <tr>
                    <th>学号</th>
                    <th>姓名</th>
                    <th>性别</th>
                    <th>年龄</th>
                    <th>已修学分</th>
                    <th>班级号</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${students}" var="student">
                    <tr>
                        <td>${student.id}</td>
                        <td>${student.name}</td>
                        <td>${student.gender}</td>
                        <td>${student.age}</td>
                        <td>${student.credit}</td>
                        <td>${student.class_id}</td>
                        <td>
                            <a href="editStudent?studentId=${student.id}" class="button">修改</a>
                            <a href="deleteStudent?studentId=${student.id}" class="button">删除</a>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>
    <div class="right">
        <h2>Teachers List</h2><a href="insertTeacher.jsp" class="button">增加</a>
        <div class="scrollable-table">
            <table>
                <thead>
                <tr>
                    <th>教师号</th>
                    <th>姓名</th>
                    <th>性别</th>
                    <th>年龄</th>
                    <th>职称</th>
                    <th>电话</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${teachers}" var="teacher">
                    <tr>
                        <td>${teacher.id}</td>
                        <td>${teacher.name}</td>
                        <td>${teacher.gender}</td>
                        <td>${teacher.age}</td>
                        <td>${teacher.office}</td>
                        <td>${teacher.phone}</td>
                        <td>
                            <a href="editTeacher?teacherId=${teacher.id}" class="button">修改</a>
                            <a href="deleteTeacher?teacherId=${teacher.id}" class="button">删除</a>
                        </td>

                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>
</div>
</body>
</html>